package cn.zl.springcloud.controller;


import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanglang
 * @Date 2020/4/11
 */
@RestController
//@RefreshScope
//@RequestMapping("api")
public class ConfigClientController {
    @Value("${spring.application.name}")
    private String applicationName;
    @Value("${eureka.client.service-url.defaultZone}")
    private String eurekaServer;
    @Value("${server.port}")
    private String port;
    private String fromValue;

/*    @GetMapping("/from")
    @ResponseBody
    public String returnFromValue(){
        return fromValue;
    }*/

    @RequestMapping("/config")
    public String getConfig(){
        return this.applicationName+this.eurekaServer+this.port;
    }
}

